<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------


use think\Route;

Route::resource('blogs','index/blog');

return [
    '__pattern__' => [
        'name' => '\w+',
        'id' => '\d+',
    ],
    '[hello]'     => [
        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

    //路由，就是简写了你原来的访问方式，如果定义了路由，原来的访问地址就失效了。
    'hello'=>'index/index/hello',

//    'demo/[:name]'=>'index/index/demo',
    'demo/[:name]'=>function ($name = 'kongkong'){
        return 'hello '.$name;
    },

    'qingqiu'=>'index/index/qingqiu',



    'test'=>'demo/index/index',
    //获取用户信息
    ':v1/user/:id'=>'api/:v1.User/read',
    ':v2/user/:id'=>'api/:v2.User/read',

    //微博
//    'blogs'=>'index/blog/index',

      'user'=>'user/SysUser/index',
];
